home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Freeware / Miro 1.0 / Miro_Installer.exe / resources / templates / external.js < prev    next >
Encoding:
Text File  |  2007-11-12  |  973 b   |  55 lines

  1. <script type="text/javascript">
  2. <!-- // Protect from our XML parser, which doesn't know to protect <script>
  3. var counting = false;
  4. var count = 0;
  5.  
  6. function startCountdown(itemID)
  7. {
  8.     counting = true;
  9.     count = 10;
  10.     updateCountdown(itemID)
  11. }
  12.  
  13. function stopCountdown()
  14. {
  15.     counting = false;
  16. }
  17.  
  18. function updateCountdown(itemID)
  19. {
  20.     if (counting)
  21.     {
  22.         count = count - 1;
  23.         if (count >= 0)
  24.         {
  25.             document.getElementById('countdown').innerHTML = count;
  26.             setTimeout('updateCountdown(' + itemID + ')', 1000);
  27.         }
  28.         else
  29.         {
  30.             skipItem(itemID)
  31.         }
  32.     }
  33. }
  34.  
  35. function playItemExternally(itemID)
  36. {
  37.     stopCountdown();
  38.     eventURL('action:playItemExternally?itemID=' + itemID)
  39. }
  40.  
  41. function skipItem(itemID)
  42. {
  43.     stopCountdown();
  44.     eventURL('action:skipItem?itemID=' + itemID)
  45. }
  46.  
  47. function revealItem(itemID)
  48. {
  49.     stopCountdown();
  50.     eventURL('action:revealItem?item=' + itemID)
  51. }
  52.  
  53. -->
  54. </script>
  55.